﻿define('model',
    ["departments", 'ko'],
   function (departments, ko) {
       var model = function () {
           var self = this;
           self.currentObj = ko.observable(new departments());
           self.activeList = ko.observable("departmentsGrid");
           
           self.countDepartments = ko.observable();
           self.countBlocks = ko.observable();
           self.countSectors = ko.observable();
           self.countProviders = ko.observable();
           self.countSpecialities = ko.observable();
           self.countPositions = ko.observable();
           
           SendAjax("/api/Departments/GetCount", {}, function (data) {
               self.countDepartments(data);
           });

           SendAjax("/api/Specialities/GetCount", {}, function (data) {
               self.countSpecialities(data);
           });
/*
           SendAjax("/api/Blocks/GetCount", {}, function (data) {
               self.countBlocks(data);
           });
           */
           SendAjax("/api/Providers/GetCount", {}, function (data) {
               self.countProviders(data);
           });
           
           SendAjax("/api/Positions/GetCount", {}, function (data) {
               self.countPositions(data);
           });
           

       };


       return model;
   });